# Copyright (C) 2017  The Bochs Project
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA

# Makefile for the cpu/avx component of bochs

.SUFFIXES: .cc

srcdir = .

top_builddir    = ../..
top_srcdir      = ../..

SHELL = /bin/sh



CC       = gcc
CFLAGS   = -g -O2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES   -I/usr/include/SDL2 -D_REENTRANT
CXX      = g++
CXXFLAGS = -g -O2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES   -I/usr/include/SDL2 -D_REENTRANT

#CFLAGS  = -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce -mpreferred-stack-boundary=2 -DCPU=686 -march=i686

LDFLAGS    = 
LIBS       = 
RANLIB     = ranlib

BX_INCDIRS = -I.. -I../.. -I$(srcdir)/.. -I$(srcdir)/../.. -I../../instrument/stubs -I$(srcdir)/../../instrument/stubs

# Objects which are only used for AVX / EVEX code
AVX_OBJS = \
	avx.o \
	avx_pfp.o \
	avx_cvt.o \
	avx_fma.o \
	avx2.o \
	avx512.o \
	avx512_broadcast.o \
	avx512_move.o \
	avx512_pfp.o \
	avx512_rcp14.o \
	avx512_rsqrt14.o \
	avx512_cvt.o \
	avx512_fma.o \
	avx512_mask8.o \
	avx512_mask16.o \
	avx512_mask32.o \
	avx512_mask64.o \
	avx512_bitalg.o \
	vnni.o \
	gather.o \
	tbm32.o \
	tbm64.o \
	xop.o

all: libavx.a

.cc.o:
	$(CXX) -c $(BX_INCDIRS) $(CXXFLAGS) $< -o $@

.c.o:
	$(CC) -c $(CFLAGS) $(BX_INCDIRS) $< -o $@


libavx.a: $(AVX_OBJS)
	rm -f  libavx.a
	ar rv $@ $(AVX_OBJS)
	$(RANLIB) libavx.a

clean:
	rm -f  *.o
	rm -f  *.a

dist-clean: clean
	rm -f  Makefile

###########################################
# dependencies generated by
#  gcc -MM -I.. -I../.. -I../../instrument/stubs *.cc | sed 's/\.cc/.cc/g'
###########################################
avx.o: avx.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../cpu/decoder/decoder.h ../../gui/paramtree.h ../../logio.h \
 ../../instrument/stubs/instrument.h ../cpu.h \
 ../decoder/decoder.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h \
 ../fpu/status_w.h ../fpu/control_w.h ../crregs.h ../descriptor.h \
 ../decoder/instr.h ../lazy_flags.h ../tlb.h ../icache.h ../apic.h \
 ../xmm.h ../vmx.h ../svm.h ../cpuid.h ../stack.h ../access.h \
 ../simd_int.h
avx2.o: avx2.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../cpu/decoder/decoder.h ../../gui/paramtree.h ../../logio.h \
 ../../instrument/stubs/instrument.h ../cpu.h \
 ../decoder/decoder.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h \
 ../fpu/status_w.h ../fpu/control_w.h ../crregs.h ../descriptor.h \
 ../decoder/instr.h ../lazy_flags.h ../tlb.h ../icache.h ../apic.h \
 ../xmm.h ../vmx.h ../svm.h ../cpuid.h ../stack.h ../access.h \
 ../simd_int.h ../simd_compare.h
avx512.o: avx512.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../cpu/decoder/decoder.h ../../gui/paramtree.h ../../logio.h \
 ../../instrument/stubs/instrument.h ../cpu.h \
 ../decoder/decoder.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h \
 ../fpu/status_w.h ../fpu/control_w.h ../crregs.h ../descriptor.h \
 ../decoder/instr.h ../lazy_flags.h ../tlb.h ../icache.h ../apic.h \
 ../xmm.h ../vmx.h ../svm.h ../cpuid.h ../stack.h ../access.h \
 ../simd_int.h ../simd_compare.h ../wide_int.h
avx512_bitalg.o: avx512_bitalg.cc ../../bochs.h ../../config.h \
 ../../osdep.h ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../cpu/decoder/decoder.h ../../gui/paramtree.h ../../logio.h \
 ../../instrument/stubs/instrument.h ../cpu.h \
 ../decoder/decoder.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h \
 ../fpu/status_w.h ../fpu/control_w.h ../crregs.h ../descriptor.h \
 ../decoder/instr.h ../lazy_flags.h ../tlb.h ../icache.h ../apic.h \
 ../xmm.h ../vmx.h ../svm.h ../cpuid.h ../stack.h ../access.h \
 ../simd_int.h ../scalar_arith.h
avx512_broadcast.o: avx512_broadcast.cc ../../bochs.h ../../config.h \
 ../../osdep.h ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../cpu/decoder/decoder.h ../../gui/paramtree.h ../../logio.h \
 ../../instrument/stubs/instrument.h ../cpu.h \
 ../decoder/decoder.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h \
 ../fpu/status_w.h ../fpu/control_w.h ../crregs.h ../descriptor.h \
 ../decoder/instr.h ../lazy_flags.h ../tlb.h ../icache.h ../apic.h \
 ../xmm.h ../vmx.h ../svm.h ../cpuid.h ../stack.h ../access.h \
 ../simd_int.h
avx512_cvt.o: avx512_cvt.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../cpu/decoder/decoder.h ../../gui/paramtree.h ../../logio.h \
 ../../instrument/stubs/instrument.h ../cpu.h \
 ../decoder/decoder.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h \
 ../fpu/status_w.h ../fpu/control_w.h ../crregs.h ../descriptor.h \
 ../decoder/instr.h ../lazy_flags.h ../tlb.h ../icache.h ../apic.h \
 ../xmm.h ../vmx.h ../svm.h ../cpuid.h ../stack.h ../access.h \
 ../simd_int.h
avx512_fma.o: avx512_fma.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../cpu/decoder/decoder.h ../../gui/paramtree.h ../../logio.h \
 ../../instrument/stubs/instrument.h ../cpu.h \
 ../decoder/decoder.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h \
 ../fpu/status_w.h ../fpu/control_w.h ../crregs.h ../descriptor.h \
 ../decoder/instr.h ../lazy_flags.h ../tlb.h ../icache.h ../apic.h \
 ../xmm.h ../vmx.h ../svm.h ../cpuid.h ../stack.h ../access.h \
 ../simd_int.h ../simd_pfp.h
avx512_mask16.o: avx512_mask16.cc ../../bochs.h ../../config.h \
 ../../osdep.h ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../cpu/decoder/decoder.h ../../gui/paramtree.h ../../logio.h \
 ../../instrument/stubs/instrument.h ../cpu.h \
 ../decoder/decoder.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h \
 ../fpu/status_w.h ../fpu/control_w.h ../crregs.h ../descriptor.h \
 ../decoder/instr.h ../lazy_flags.h ../tlb.h ../icache.h ../apic.h \
 ../xmm.h ../vmx.h ../svm.h ../cpuid.h ../stack.h ../access.h
avx512_mask32.o: avx512_mask32.cc ../../bochs.h ../../config.h \
 ../../osdep.h ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../cpu/decoder/decoder.h ../../gui/paramtree.h ../../logio.h \
 ../../instrument/stubs/instrument.h ../cpu.h \
 ../decoder/decoder.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h \
 ../fpu/status_w.h ../fpu/control_w.h ../crregs.h ../descriptor.h \
 ../decoder/instr.h ../lazy_flags.h ../tlb.h ../icache.h ../apic.h \
 ../xmm.h ../vmx.h ../svm.h ../cpuid.h ../stack.h ../access.h
avx512_mask64.o: avx512_mask64.cc ../../bochs.h ../../config.h \
 ../../osdep.h ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../cpu/decoder/decoder.h ../../gui/paramtree.h ../../logio.h \
 ../../instrument/stubs/instrument.h ../cpu.h \
 ../decoder/decoder.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h \
 ../fpu/status_w.h ../fpu/control_w.h ../crregs.h ../descriptor.h \
 ../decoder/instr.h ../lazy_flags.h ../tlb.h ../icache.h ../apic.h \
 ../xmm.h ../vmx.h ../svm.h ../cpuid.h ../stack.h ../access.h
avx512_mask8.o: avx512_mask8.cc ../../bochs.h ../../config.h \
 ../../osdep.h ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../cpu/decoder/decoder.h ../../gui/paramtree.h ../../logio.h \
 ../../instrument/stubs/instrument.h ../cpu.h \
 ../decoder/decoder.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h \
 ../fpu/status_w.h ../fpu/control_w.h ../crregs.h ../descriptor.h \
 ../decoder/instr.h ../lazy_flags.h ../tlb.h ../icache.h ../apic.h \
 ../xmm.h ../vmx.h ../svm.h ../cpuid.h ../stack.h ../access.h
avx512_move.o: avx512_move.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../cpu/decoder/decoder.h ../../gui/paramtree.h ../../logio.h \
 ../../instrument/stubs/instrument.h ../cpu.h \
 ../decoder/decoder.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h \
 ../fpu/status_w.h ../fpu/control_w.h ../crregs.h ../descriptor.h \
 ../decoder/instr.h ../lazy_flags.h ../tlb.h ../icache.h ../apic.h \
 ../xmm.h ../vmx.h ../svm.h ../cpuid.h ../stack.h ../access.h \
 ../simd_int.h
avx512_pfp.o: avx512_pfp.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../cpu/decoder/decoder.h ../../gui/paramtree.h ../../logio.h \
 ../../instrument/stubs/instrument.h ../cpu.h \
 ../decoder/decoder.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h \
 ../fpu/status_w.h ../fpu/control_w.h ../crregs.h ../descriptor.h \
 ../decoder/instr.h ../lazy_flags.h ../tlb.h ../icache.h ../apic.h \
 ../xmm.h ../vmx.h ../svm.h ../cpuid.h ../stack.h ../access.h \
 ../fpu/softfloat-compare.h ../fpu/softfloat.h ../simd_int.h \
 ../simd_pfp.h ../fpu/softfloat-specialize.h
avx512_rcp14.o: avx512_rcp14.cc ../../bochs.h ../../config.h \
 ../../osdep.h ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../cpu/decoder/decoder.h ../../gui/paramtree.h ../../logio.h \
 ../../instrument/stubs/instrument.h ../cpu.h \
 ../decoder/decoder.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h \
 ../fpu/status_w.h ../fpu/control_w.h ../crregs.h ../descriptor.h \
 ../decoder/instr.h ../lazy_flags.h ../tlb.h ../icache.h ../apic.h \
 ../xmm.h ../vmx.h ../svm.h ../cpuid.h ../stack.h ../access.h \
 ../fpu/softfloat-specialize.h ../fpu/softfloat.h \
 ../fpu/softfloat-round-pack.h ../simd_int.h
avx512_rsqrt14.o: avx512_rsqrt14.cc ../../bochs.h ../../config.h \
 ../../osdep.h ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../cpu/decoder/decoder.h ../../gui/paramtree.h ../../logio.h \
 ../../instrument/stubs/instrument.h ../cpu.h \
 ../decoder/decoder.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h \
 ../fpu/status_w.h ../fpu/control_w.h ../crregs.h ../descriptor.h \
 ../decoder/instr.h ../lazy_flags.h ../tlb.h ../icache.h ../apic.h \
 ../xmm.h ../vmx.h ../svm.h ../cpuid.h ../stack.h ../access.h \
 ../fpu/softfloat-specialize.h ../fpu/softfloat.h \
 ../fpu/softfloat-round-pack.h ../simd_int.h
avx_cvt.o: avx_cvt.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../cpu/decoder/decoder.h ../../gui/paramtree.h ../../logio.h \
 ../../instrument/stubs/instrument.h ../cpu.h \
 ../decoder/decoder.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h \
 ../fpu/status_w.h ../fpu/control_w.h ../crregs.h ../descriptor.h \
 ../decoder/instr.h ../lazy_flags.h ../tlb.h ../icache.h ../apic.h \
 ../xmm.h ../vmx.h ../svm.h ../cpuid.h ../stack.h ../access.h
avx_fma.o: avx_fma.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../cpu/decoder/decoder.h ../../gui/paramtree.h ../../logio.h \
 ../../instrument/stubs/instrument.h ../cpu.h \
 ../decoder/decoder.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h \
 ../fpu/status_w.h ../fpu/control_w.h ../crregs.h ../descriptor.h \
 ../decoder/instr.h ../lazy_flags.h ../tlb.h ../icache.h ../apic.h \
 ../xmm.h ../vmx.h ../svm.h ../cpuid.h ../stack.h ../access.h \
 ../simd_pfp.h
avx_pfp.o: avx_pfp.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../cpu/decoder/decoder.h ../../gui/paramtree.h ../../logio.h \
 ../../instrument/stubs/instrument.h ../cpu.h \
 ../decoder/decoder.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h \
 ../fpu/status_w.h ../fpu/control_w.h ../crregs.h ../descriptor.h \
 ../decoder/instr.h ../lazy_flags.h ../tlb.h ../icache.h ../apic.h \
 ../xmm.h ../vmx.h ../svm.h ../cpuid.h ../stack.h ../access.h \
 ../fpu/softfloat-compare.h ../fpu/softfloat.h ../simd_pfp.h \
 ../simd_int.h
gather.o: gather.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../cpu/decoder/decoder.h ../../gui/paramtree.h ../../logio.h \
 ../../instrument/stubs/instrument.h ../cpu.h \
 ../decoder/decoder.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h \
 ../fpu/status_w.h ../fpu/control_w.h ../crregs.h ../descriptor.h \
 ../decoder/instr.h ../lazy_flags.h ../tlb.h ../icache.h ../apic.h \
 ../xmm.h ../vmx.h ../svm.h ../cpuid.h ../stack.h ../access.h
tbm32.o: tbm32.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../cpu/decoder/decoder.h ../../gui/paramtree.h ../../logio.h \
 ../../instrument/stubs/instrument.h ../cpu.h \
 ../decoder/decoder.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h \
 ../fpu/status_w.h ../fpu/control_w.h ../crregs.h ../descriptor.h \
 ../decoder/instr.h ../lazy_flags.h ../tlb.h ../icache.h ../apic.h \
 ../xmm.h ../vmx.h ../svm.h ../cpuid.h ../stack.h ../access.h \
 ../scalar_arith.h
tbm64.o: tbm64.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../cpu/decoder/decoder.h ../../gui/paramtree.h ../../logio.h \
 ../../instrument/stubs/instrument.h ../cpu.h \
 ../decoder/decoder.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h \
 ../fpu/status_w.h ../fpu/control_w.h ../crregs.h ../descriptor.h \
 ../decoder/instr.h ../lazy_flags.h ../tlb.h ../icache.h ../apic.h \
 ../xmm.h ../vmx.h ../svm.h ../cpuid.h ../stack.h ../access.h \
 ../scalar_arith.h
vnni.o: vnni.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../cpu/decoder/decoder.h ../../gui/paramtree.h ../../logio.h \
 ../../instrument/stubs/instrument.h ../cpu.h \
 ../decoder/decoder.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h \
 ../fpu/status_w.h ../fpu/control_w.h ../crregs.h ../descriptor.h \
 ../decoder/instr.h ../lazy_flags.h ../tlb.h ../icache.h ../apic.h \
 ../xmm.h ../vmx.h ../svm.h ../cpuid.h ../stack.h ../access.h \
 ../simd_int.h
xop.o: xop.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../cpu/decoder/decoder.h ../../gui/paramtree.h ../../logio.h \
 ../../instrument/stubs/instrument.h ../cpu.h \
 ../decoder/decoder.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h \
 ../fpu/status_w.h ../fpu/control_w.h ../crregs.h ../descriptor.h \
 ../decoder/instr.h ../lazy_flags.h ../tlb.h ../icache.h ../apic.h \
 ../xmm.h ../vmx.h ../svm.h ../cpuid.h ../stack.h ../access.h \
 ../simd_int.h ../simd_compare.h
